package com.example.designpatterns.behavioral.command;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zuitu@foxmail.com
 * @date 2024/1/17
 */
@Component
public class TurnOffCommandImpl implements Command {
    @Autowired
    private Blub blub;

    @Override
    public void execute() {
        blub.turnOff();
    }

    @Override
    public void undo() {
        blub.turnOn();
    }

    @Override
    public void redo() {
        execute();
    }
}
